package com.uqbar.game.components.extra;

import com.uqbar.game.scene.GameAsteroid;
import com.uqbar.vainilla.DeltaState;
import com.uqbar.vainilla.GameComponent;
import com.uqbar.vainilla.GameScene;
import com.uqbar.vainilla.appearances.Sprite;
import com.uqbar.vainilla.events.constants.Key;

public class InitialComponent extends GameComponent<GameScene> {
	private GameAsteroid gameAsteroid; 
	
	public InitialComponent(GameAsteroid gameAsteroid){
		this.gameAsteroid = gameAsteroid;
		this.setAppearance(Sprite.fromImage("/background/presentation.png"));
	}
	
	public void update(DeltaState deltaState){
		if(deltaState.isKeyPressed(Key.ENTER)){
			this.gameAsteroid.play();
		}
	}
}
